import { _decorator, Component, Node } from "cc";
import BasePanel from "../../../core/component/BasePanel";
import WindowManager from "../../../core/manager/WindowManager";
import Data from "../../../core/manager/Data";
const { ccclass, property } = _decorator;

@ccclass("JumpLVLayer")
export class JumpLVLayer extends BasePanel {
  start() {}

  update(deltaTime: number) {}

  onBtnClicked(event: any, customEventData: any) {
    var btnName = event.target.name;
    switch (btnName) {
      case "btn_close":
        this.close();
        break;
      case "btn_go5":
        console.log("go5");
        Data.user.lv = 5;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
      case "btn_go10":
        console.log("go10");    
        Data.user.lv = 10;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
      case "btn_go15":
        console.log("go15");
        Data.user.lv = 15;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
      case "btn_go20":
        console.log("go20");
        Data.user.lv = 20;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
      case "btn_go25":
        console.log("go25");
        Data.user.lv = 25;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
      case "btn_go30":
        console.log("go30");
        Data.user.lv = 30;
        WindowManager.ins.open("LevelLayer");
        this.close();
        break;
    }
  }
}
